package com.zyh.homework.test6.domain;

public class Circle extends Graphic{
    private double radius;

    public Circle() {
    }
    public Circle(double radius) {
        this.radius = radius;
    }

    @Override
    public double getArea() {
        return Math.PI*Math.pow(getRadius(),2);
    }

    @Override
    public double getPerimeter() {
        return Math.PI*getRadius()*2;
    }

    @Override
    public String getInfo() {
        return "圆形的半径是"+getRadius()+"面积是"+getArea()+"周长是"+getPerimeter();
    }

    public double getRadius() {
        return radius;
    }

    public void setRadius(double radius) {
        this.radius = radius;
    }
}
